package com.example.qingyiapp.ui.activity.fragment.fragment_FindUI.adapter;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * Creadted by Met·Wang on 2019/9/17 14:14
 * Describe: NullPointerException Write
 */
public class FindfragmentAdapter extends FragmentPagerAdapter {

    ArrayList<Fragment> fragments;
    ArrayList<String>  strings;

    public FindfragmentAdapter(FragmentManager fm, ArrayList<Fragment> fragments, ArrayList<String> strings) {
        super(fm);
        this.fragments = fragments;
        this.strings = strings;
    }

    @Override
    public Fragment getItem(int i) {
        return fragments.get(i);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return strings.get(position);
    }
}

